package cn.veliger.service;

import cn.veliger.domain.User;
import cn.veliger.mapper.UserMapper;
import cn.veliger.page.PageResult;
import cn.veliger.qo.BaseQueryObject;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author veliger@163.com
 * @version 1.0
 * @create 2018-11-08 10:44
 * @desc
 **/
@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    public PageResult<User> queryObject(BaseQueryObject qo) {
        PageHelper.offsetPage(qo.getStart(), qo.getPageSize());
        List<User> userList = userMapper.selectAll();
        return new PageResult<>(userList);
    }
}
